/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.fii.entity;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author Zeus
 */
@Entity
@Table(name = "pg_detalle_grupos", catalog = "prog_acad", schema = "")
@NamedQueries({
    @NamedQuery(name = "PgDetalleGrupos.findAll", query = "SELECT p FROM PgDetalleGrupos p"),
    @NamedQuery(name = "PgDetalleGrupos.findByPgcodGrupo", query = "SELECT p FROM PgDetalleGrupos p WHERE p.pgDetalleGruposPK.pgcodGrupo = :pgcodGrupo"),
    @NamedQuery(name = "PgDetalleGrupos.findByPgDia", query = "SELECT p FROM PgDetalleGrupos p WHERE p.pgDetalleGruposPK.pgDia = :pgDia"),
    @NamedQuery(name = "PgDetalleGrupos.findByPghInicio", query = "SELECT p FROM PgDetalleGrupos p WHERE p.pghInicio = :pghInicio"),
    @NamedQuery(name = "PgDetalleGrupos.findByPghFin", query = "SELECT p FROM PgDetalleGrupos p WHERE p.pghFin = :pghFin")})
public class PgDetalleGrupos implements Serializable {
    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected PgDetalleGruposPK pgDetalleGruposPK;
    @Basic(optional = false)
    @Column(name = "pg_hInicio", nullable = false)
    @Temporal(TemporalType.DATE)
    private Date pghInicio;
    @Basic(optional = false)
    @Column(name = "pg_hFin", nullable = false)
    @Temporal(TemporalType.DATE)
    private Date pghFin;

    public PgDetalleGrupos() {
    }

    public PgDetalleGrupos(PgDetalleGruposPK pgDetalleGruposPK) {
        this.pgDetalleGruposPK = pgDetalleGruposPK;
    }

    public PgDetalleGrupos(PgDetalleGruposPK pgDetalleGruposPK, Date pghInicio, Date pghFin) {
        this.pgDetalleGruposPK = pgDetalleGruposPK;
        this.pghInicio = pghInicio;
        this.pghFin = pghFin;
    }

    public PgDetalleGrupos(String pgcodGrupo, char pgDia) {
        this.pgDetalleGruposPK = new PgDetalleGruposPK(pgcodGrupo, pgDia);
    }

    public PgDetalleGruposPK getPgDetalleGruposPK() {
        return pgDetalleGruposPK;
    }

    public void setPgDetalleGruposPK(PgDetalleGruposPK pgDetalleGruposPK) {
        this.pgDetalleGruposPK = pgDetalleGruposPK;
    }

    public Date getPghInicio() {
        return pghInicio;
    }

    public void setPghInicio(Date pghInicio) {
        this.pghInicio = pghInicio;
    }

    public Date getPghFin() {
        return pghFin;
    }

    public void setPghFin(Date pghFin) {
        this.pghFin = pghFin;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (pgDetalleGruposPK != null ? pgDetalleGruposPK.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof PgDetalleGrupos)) {
            return false;
        }
        PgDetalleGrupos other = (PgDetalleGrupos) object;
        if ((this.pgDetalleGruposPK == null && other.pgDetalleGruposPK != null) || (this.pgDetalleGruposPK != null && !this.pgDetalleGruposPK.equals(other.pgDetalleGruposPK))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.fii.entity.PgDetalleGrupos[ pgDetalleGruposPK=" + pgDetalleGruposPK + " ]";
    }
    
}
